<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="factory.comm.*,vo.comm.*" %>
<%@ page import="java.util.*" %>
<%
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ request.getContextPath() + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<title>查看评分</title>
</head>
<style type="text/css">
body{
	margin:0px;
	padding:0px;
	overflow:hidden;
}
#wrapper{
	position:absolute;
	width:100%;
	height:100%;
	min-width:1280px;
	min-height:680px;
	overflow-x:hidden;
	overflow-y:hidden;
    background-image: -moz-linear-gradient(top,#77D1F6, #2F368F);
    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #77D1F6),color-stop(1, #2F368F));
}
#header{
	height:100px;
	width:100%;
}

#heading{
	position:relative;
	float:left;
	margin-left:20%;
	margin-top:-18px;
	height:110px;
	width:60%;
	border-radius: 18px;
	background-color:#1C75BC;
	opacity:0.6;
}
#heading #title{
	margin-top:40px;
	text-align:center;
	font-family:微软雅黑;
	font-size:24px;
	font-weight:bold;
}

#main{
	margin-top:20px;
	height:500px;
	width:100%;
}
#mainBg{
	position:relative;
	float:left;
	margin-left:20%;
	margin-top:0px;
	height:500px;
	width:60%;
    border-radius: 18px;
    background-color:#000000;
    opacity:0.5;
}
#mainPanel{
    position:relative;
	margin:25px;
	height:450px;
    border-radius: 18px;
    background-image: -moz-linear-gradient(top,#EBEBEB, #BFBFBF);
    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #EBEBEB),color-stop(1, #BFBFBF));
	text-align:center;
}
#welcome{
	margin-top:20px;
	height:60px;
	width:100%;
	vertical-align: middle;
	display: inline-block;
	line-height: 60px;
	text-align:center;
}
#welcome #welcome-text{
	font-size:38px;
	font-weight:bold;
	font-family:微软雅黑;
	text-shadow: 0 1px 1px #F6F6F6;
}
#name{
	height: 35px;
	width: 100%;
	margin-top: 20px;
	vertical-align: middle;
	display: inline;
	line-height: 35px;
}
#button-group{
	margin-top:10px;
	height:35px;
	width:100%;
	vertical-align: middle;
	display: inline-block;
	line-height: 35px;
	text-align:center;
}
#error-tip{
	margin-top:20px;
	margin-left:5%;
	height:40px;
	width:90%;
	vertical-align: middle;
	display: inline-block;
	line-height: 35px;
	text-align:center;
	border-bottom:2px solid #F6F6F6;
	border-bottom-style:groove;
}
#error-tip #tip-text{
	font-size:18px;
	font-weight:bold;
	font-family:微软雅黑;
	color:red;
}
.item{
	margin-left: 20px;
	font-family: 微软雅黑;
	font-size: 20px;
	font-weight: bold;
	float: none;
	width: 80px;
	margin-top: 3px;
	text-align: center;
	text-shadow: 0 1px 1px #F6F6F6;
}
.input{
	vertical-align: middle;
	display: inline-block;
}
.form-input{
	height:20px;
}
.btn{
    border:1px solid #cccccc;
    cursor:pointer;
    margin:10px 5px;
    height:40px;
	width:80px;
    text-align:center;
    border-radius: 4px;
    border-color: #636263 #464647 #A1A3A5;
    text-shadow: 0 1px 1px #F6F6F6;
    background-image: -moz-linear-gradient(center top, #D9D9D9, #A6A6A6 49%, #A6A6A6 50%);
    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #D9D9D9),color-stop(1, #A6A6A6));
}
#footer{
	margin-top:20px;
	width:100%;
}
#footer #text{
	text-align:center;
	font-size:14px;
	font-family:微软雅黑;
	font-weight:bold;
}
</style>
<body>
<div id="wrapper">
	<div id="header">
		<div id="heading">
			<div id="title">查看评分</div>
		</div>
	</div>
	<div id="main">
		<div id="mainBg">
		  <div id="mainPanel">					
				<form action="servlet.comm.AvgScoreServlet" method="post">
					<!-- start of login form -->
					<div id="welcome">
						<span id="welcome-text">查看评分</span>
					</div>
					<div id="name">
						<span class="item">请输入要查看评分的作业号:</span>
						<span><input type="text" name="homeworkid" class="form-input"></span>
					</div>
					<div id="button-group">
						<input type="submit" class="btn" value="查看"/>
						<input type="reset" class="btn" value="重置"/>
					</div>
					<!-- end of form -->
					</form>
					<%
try{
	String keyWord1=(String)request.getSession().getAttribute("homeworkid1");
	String keyWord2=(String)request.getSession().getAttribute("userid");
	List<Homework> all=HomeworkDAOFactory.getIHomeworkDAOInstance().findScore(keyWord1,keyWord2);
	Iterator<Homework> iter=all.iterator();
%>
         <table border="0" width="100%">
         			<p></p>
					<div id="name">
                    <tr>
                    <td>
						<span class="item">作业ID号</span>
					</td>
					</div>
                    <div id="name">
                    <td>
						<span class="item">批改人</span>
                    </td>
					</div>
                    <div id="name">
                    <td>
						<span class="item">分数</span>
                    </td>
                     </tr>
					</div>
<%
	while(iter.hasNext()){
		Homework homework=iter.next();
%>
	<tr>
		<td><span class="item"><%=homework.getHomeworkid() %></span></td>
		<td><span class="item"><%=homework.getUserid() %></span></td>
		<td><span class="item"><%=homework.getScore() %></span></td>
	</tr>
<%
	} 
%>
	</table>
<%
}catch(Exception e){
	e.printStackTrace();
}
%>
					<div id="name">
                    <td>
						<span class="item">该作业的平均分</span>
                    </td>
                    <td><span class="item"><%=request.getSession().getAttribute("avgscore") %></span></td>
					</div>
		  </div>
	  </div>
  	</div>
</div>
	<div id="footer">
		<div id="text">Copyright © 2015 All Rights Reserved Powered By Xiaoyukang</div>
	</div>
    </div>
</div>
</body>
</html>